/*
 * Created on Dec 5, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.vectrics.location;

import java.util.Comparator;
import org.apache.log4j.Logger;

/**
 * @author mmoore
 * 
 */
public class LocationComparator implements Comparator<Location> {
	
	private transient static Logger log = Logger.getLogger(LocationComparator.class);

	public LocationComparator() {
		super();
	}

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Location l1, Location l2) {
		log.debug("compare() Called");
		int result = l1.getName().compareTo(l2.getName());
		
		if (result == 0) {
			result = l1.getId().compareTo(l2.getId());
		}
		return result;
	}

}
